/*
 * @Author: your name
 * @Date: 2021-11-01 15:56:55
 * @LastEditTime: 2021-11-05 09:42:47
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /my-draw/src/utils/draw/draw.constant.ts
 */

import type {
    Feature,
    GeoJSON,
    FeatureCollection,
    Geometry,
    GeometryCollection,
    Point,
    Position,
    MultiPoint,
    MultiLineString,
    MultiPolygon,
    Polygon,
    LineString,
    BBox,
    GeoJsonProperties
} from './geojson'

export {
    Feature,
    GeoJSON,
    FeatureCollection,
    Geometry,
    GeometryCollection,
    Point,
    Position,
    BBox,
    MultiPoint,
    MultiLineString,
    MultiPolygon,
    Polygon,
    LineString,
    GeoJsonProperties
}

export type EditorOptions = {
    color: string,
    style?: 'circle' | 'line' | 'fill',
    type?: 'point' | 'line' | 'polygon',
    feature?: string
}

// 图层名
// export const DRAW_LAYER: string = 'my-editor-layer-name'

// 编辑模式
export enum EMode {
    STATIC = 'static', // 普通模式
    DRAW_POINT = 'draw_point', // 绘点模式
    DRAW_POLYLINE = 'draw_polyline', // 绘线模式
    DRAW_POLYGON = 'draw_polygon', // 多边形
    DRAW_CIRCLE = 'draw_circle', // 圆形
    DRAW_RECT = 'draw_rect', // 矩形
    EDIT = 'edit', // 编辑
    DELETE = 'delete', // 删除
}

// 鼠标指针
export enum ECursor {
    POINTER = 'pointer', // 手指
    CROSSHAIR = 'crosshair', // 十字
    NW_RESIZE = 'nw-resize', // ↖
    MOVE = 'move', // 可移动
    DEFAULT = '' // 默认
}

// 普通 object
export type Object = {
    [key: string]: string | number | boolean
}

// 存储 Function 的 object
export type FunctionObj = {
    [key: string]: Function
}

// 存储 geojson 的 object
export type FeatureStore = {
    [key: string]: GeoJSON
}
